// 统一的 Token Key 常量及便捷方法
export const STORAGE_TOKEN_KEY = 'ancientseeker_token'

export function getToken() {
  return localStorage.getItem(STORAGE_TOKEN_KEY)
}

export function setToken(token) {
  localStorage.setItem(STORAGE_TOKEN_KEY, token)
}

export function removeToken() {
  localStorage.removeItem(STORAGE_TOKEN_KEY)
}

export function authHeader() {
  const t = getToken()
  return t ? { Authorization: `Bearer ${t}` } : {}
}